//
//  ThirdTableViewCell.m
//  bh
//
//  Created by lanou on 15/12/21.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "ThirdTableViewCell.h"

@implementation ThirdTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _pictureView = [[UIImageView alloc]initWithFrame:(CGRectMake(5, 0, 60, 60))];
        
        _pictureView.layer.masksToBounds = YES;
        _pictureView.layer.borderWidth = 2;
        _pictureView.layer.cornerRadius = _pictureView.bounds.size.width / 2;
        _pictureView.layer.borderColor = [UIColor clearColor].CGColor;
        [self.contentView addSubview:_pictureView];
        
        _aythorNameLabel = [[UILabel alloc]initWithFrame:(CGRectMake(70, 5, 100, 30))];
        _aythorNameLabel.textColor = [UIColor orangeColor];
        [self.contentView addSubview:_aythorNameLabel];
        
        _content = [[UILabel alloc]initWithFrame:(CGRectMake(70, 35, 200, 30))];
        _content.textColor = [UIColor grayColor];
        [self.contentView addSubview:_content];
        
        _create_timeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(kWidth - 75, 10, 80, 30))];
        _create_timeLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:_create_timeLabel];

    }
    return self;
}

- (void)setPicture:(Picture *)picture{
    if (_picture != picture) {
        _picture = picture;
        [_pictureView setImageWithURL:[NSURL URLWithString:picture.author_face]];
        _aythorNameLabel.text = picture.author_nick;
        _content.text = picture.content;
        _create_timeLabel.text = picture.create_time;
    }
    
}







- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
